<template>
	<view class="more_info">
		<view class="more_box" v-for="(item,index) in detail" :key="index">
			<u-cell-item v-if="item.type && item.type == 'leader'" hover-class="none" :border-top="false" :border-bottom="false" :arrow="false" :title="item.title">
				<navigator :url="'/pagesim/center/info?type=user&id=' + item.leader.id" class="leader-avatar-box" slot="right-icon">
					<image :src="item.leader.avatar" class="leader-avatar" mode="widthFix"></image>
					<u-icon name="arrow-right"></u-icon>
				</navigator>
			</u-cell-item>
			<!-- <view v-else-if="item.name == 'id'" @click="clipboardId(item.value)" hover-class="none" :border-top="false" :border-bottom="false" :arrow="false" :title="item.title">
				<view slot="right-icon">{{item.value}}</view>
			</view> -->
			<u-cell-item v-else hover-class="none" :border-top="false" :border-bottom="false" :arrow="false" :title="item.title">
				<view slot="right-icon">{{item.value}}</view>
			</u-cell-item>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				id:0,
				type: '',
				detail: [],
				userinfo: [],
			}
			
		},
		onLoad(option){
			this.id = option.id ? option.id:0;
			this.type = option.type ? option.type:'user';
			this.userinfo = uni.getStorageSync('userinfo');// 防止需要在pageDataLoad使用到用户ID
			this.ws.pageFun(this.pageDataLoad, this);
		},
		methods:{
			pageDataLoad: function (refresh = false) {
				var that = this
				this.ws.send({
					c: 'User',
					a: 'infoDetail',
					data: {
						'method': 'get',
						'type': that.type,
						'id': that.id ? that.id:that.userinfo.id,
						'requestor': that.userinfo.id,
						'refresh': refresh
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
page{
	background-color: #EDEDED;
}
.more_box{
	background-color: #FFFFFF;
	border-bottom: 1rpx solid #F2F2F2;
	// margin-bottom: 1rpx;
}
.more_box:nth-last-child(1){
	border-bottom: 0;
}
.leader-avatar-box {
	display: flex;
	align-items: center;
}
</style>